<table class="table table-striped" style="height: 50px;">
    <thead>
    <tr>
        <td></td>
        <th>预约产品</th>
        <th>用户</th>
        <th>消费共享豆</th>
        <th>创建时间</th>
        <th>当前状态</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>预约信息：</td>
        <td>{$info.title}</td>
        <td>{$info.uid|get_uname}</td>
        <td>
            {if condition="$info['isadd'] eq 1"}+{/if}
            {if condition="$info['isadd'] eq 2"}-{/if}
            {$info.delpoint|intval}
        </td>
        <td>
            {$info.ctime|date='Y-m-d H:i:s',###}
        </td>
        <td>
            {if condition="$info['status'] eq 0" }未处理{/if}
            {if condition="$info['status'] eq 1" }已扣除{/if}
            {if condition="$info['status'] eq 2" }<span style='color:#999'>已返还</span>{/if}
        </td>
    </tr>
    </tbody>
</table>
<span>可选择订单总数：{$total}</span>
<!--今日可以卖出的订单-->
<div style="height: 300px; overflow-y: scroll">
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>编号</th>
                <th>购买人</th>
                <th>产品信息</th>
                <th>购买时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        {foreach $list as $item}
        <tr>
            <td>{$item.order_id}</td>
            <td>
                <label class="label label-primary">账号：{$item.user_name}</label><br>
                <label class="label label-danger">手机号：{$item.telephone}</label>
            </td>
            <td>
                <label class="label label-success">{$item.title}</label><br>
                <label class="label label-default">{$item.basicprice}</label>
            </td>
            <td>
                {$item.ctime|show_datetime}
            </td>
            <td>
                <label class="label label-primary" style="cursor: pointer;" onclick="subOrder('{$item.order_id}', '{$info.id}')">指定此订单</label>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</div>
<script>
    function subOrder(order_id, apply_id) {
        layer.confirm('确定指定此订单？', function(r) {
            $.ajax({
                url:"{:url('setOrder')}",
                data:{
                    order_id,
                    apply_id
                },
                dataType:'JSON',
                type:'POST',
                success:function (res) {
                    if(res.status==0){
                        layer.msg('指定成功');
                        setTimeout(function () {
                            window.parent.location.reload();
                        }, 666)
                    }else{
                        layer.msg('指定失败')
                    }
                }
            })
        })
    }

</script>



